package com.itheima.demo03;

import java.util.Date;

public class DateDemo {

    public static void main(String[] args) {

        Date date = new Date();         //Tue Aug 27 18:06:40 CST 2019
        System.out.println(date);

        Date date1 = new Date(1566900595832L);
        System.out.println(date1);

        //public long getTime()
        long time = date.getTime();       //1566900595832
        System.out.println(time);

        //public void setTime(long time)设置时间，给的是毫秒值
       Date date2 = new Date();
        System.out.println(date2);

        date2.setTime(1566900595832L);
        System.out.println(date2);
    }
}
